package com.gardenguell.salad.ui.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.gardenguell.salad.R;
import com.gardenguell.salad.app.HandlerCenter;
import com.gardenguell.salad.ui.activity.ControlActivity;
import com.gardenguell.salad.ui.activity.MainActivity;
import com.gardenguell.salad.util.ViewUtil;

/**
 * Created by absurd on 2015/11/21.
 */
public class HomeFragment extends BaseFragment {

    private HandlerCenter mHandlerCenter = HandlerCenter.getInstance();

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View root = inflater.inflate(R.layout.fragment_home, container, false);
        //configureActionBar("My Farm", R.drawable.sel_actionbar_left_back, R.drawable.sel_actionbar_drawer );
        ViewUtil.setChildOnClickListener(root, new int[]{R.id.iv_farm1, R.id.iv_farm2, R.id.iv_farm3, R.id.iv_farm4},this);
        ((MainActivity)getBaseActivity()).showToolbar();

        return root;
    }

    @Override
    public void onClick(View v) {
        super.onClick(v);
        switch(v.getId()){
            case R.id.iv_farm1:
                startActivity(new Intent(HomeFragment.this.getBaseActivity(), ControlActivity.class));
                break;
            case R.id.iv_farm2:
                break;
            case R.id.iv_farm3:
                break;
            case R.id.iv_farm4:
                break;
            default:
                break;
        }
    }
}
